package innerClass;

/**
 * @Author:zimmor
 * @Date: 2021/3/24 16:53
 * @Description
 * @version: 1.0.0
 */

public class InnerClassDemo2 {
    public void test(Interface interface1) {
        System.out.println(interface1.getName());
        interface1.log();
    }

    public static void main(String[] args) {
        InnerClassDemo2 innerClassDemo2 = new InnerClassDemo2();
        innerClassDemo2.test(new Interface() {
            public void log() {
                System.out.println("匿名内部内log");
            }

            public String getName() {
                return "匿名内部类没有名字";
            }
        });
    }
}
